package com.zhen.aikan.controller;

import com.zhen.aikan.service.IGitHubService;
import com.zhen.aikan.vo.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author LiJiaZhen
 * @date 2023/11/9 15:17
 */
@Api(tags = "GitHub控制器")
@RestController
@RequestMapping("/api/gitHub")
public class GitHubController {
    @Autowired
    private IGitHubService gitHubService;

    @PostMapping("/upload")
    public Result upload (@RequestParam("file") MultipartFile multipartFile,@RequestParam("msg") String message){
        String url = gitHubService.upload(multipartFile,message);
        return Result.ok(url);
    }
}
